﻿<Window xmlns:ctrls="clr-namespace:EtlViewer.Viewer.Controls"  
        x:Name="window"
        x:Class="EtlViewer.Viewer.MainWindow"
        x:ClassModifier="internal"        
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:l="clr-namespace:EtlViewer.Viewer"
        xmlns:utils="clr-namespace:EtlViewer.Viewer.UIUtils"   
        xmlns:model="clr-namespace:EtlViewer.Viewer.Models"
        xmlns:views="clr-namespace:EtlViewer.Viewer.Views"
        Title="SvcPerf"         
        Height="600" Width="1280" 
        WindowStartupLocation="CenterScreen" 
        WindowState="Normal" 
        WindowStyle="SingleBorderWindow" 
        ResizeMode="CanResizeWithGrip"
        AllowDrop="True" 
        Drop="Window_Drop" 
        Margin="0,0,0,0"
        Activated="Window_Activated"         
        Closing="window_Closing_1"
        Closed="window_Closed_1"
        Padding="0"        
        Icon="CSD_banner.ico">
    <Window.Resources>
        <utils:TimeSpanToVisibility x:Key="TimeSpanToVisibility"/>
        <utils:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>
        <utils:CustomBoolToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <utils:TimeIntervalConverter x:Key="TimeIntervalConverter" />
        <utils:RealTimeSpinnyConverter x:Key="RealTimeSpinnyConverter" />
        <utils:FilterModeConverter x:Key="FilterModeConverter" />
        <utils:ToStringFormatConverter x:Key="ToStringFormatConverter" />

        <Style x:Key="ListboxyStyle" TargetType="ListBox">
            <Setter Property="BorderThickness" Value="0"></Setter>
            <Style.Resources>
                <!-- Background of selected item when focussed -->
                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="LightBlue" />
                <!-- Background of selected item when not focussed -->
                <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="LightBlue" />
            </Style.Resources>
        </Style>

        <Style TargetType="ListBoxItem">
            <Setter Property="BorderThickness" Value="0"></Setter>
        </Style>

        <Style TargetType="{x:Type Expander}" x:Key="FilterAndDurationExpanderStyle" BasedOn="{StaticResource MetroExpander}">
            <Setter Property="Header" Value="FILTERS AND DURATION" />
            <Setter Property="Visibility"  Value="{Binding Path=CanShowEvents, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        </Style>

        <Style TargetType="{x:Type MenuItem}" >
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="Padding" Value="10,0,10,0"/>
            <!--<Style.Triggers>
                <Trigger  Property=""  Value="False" >
                    <Setter Property="Background" Value="{StaticResource MetroBlueColorBrush}"/>
                    <Setter Property="Foreground" Value="{StaticResource WhiteColorBrush}" />
                </Trigger>
            </Style.Triggers>-->
        </Style>
    </Window.Resources>

    <Window.CommandBindings>
        <CommandBinding Command="Open" Executed="CommandBinding_Executed" CanExecute="CommandBinding_CanExecute"/>
        <CommandBinding Command="Delete" Executed="CommandBinding_Duration" CanExecute="CommandBinding_CanExecute"/>
        <CommandBinding Command="Cut" Executed="CommandBinding_Clear" CanExecute="CommandBinding_CanExecute"/>
        <CommandBinding Command="Find" Executed="CommandBinding_Find" CanExecute="CommandBinding_CanExecute_Find"/>
        <CommandBinding Command="Refresh" Executed="CommandBinding_Refresh" CanExecute="CommandBinding_CanExecute" />
        <CommandBinding Command="Close" Executed="CommandBinding_Close" CanExecute="CommandBinding_CanExecute" />
        <CommandBinding Command="Help" Executed="CommandBinding_Help" CanExecute="CommandBinding_CanExecute" />
        <CommandBinding Command="l:MainWindow.AddManifestCommand" Executed="CommandBinding_AddManifest" CanExecute="CommandBinding_CanExecute" />
        <CommandBinding Command="l:MainWindow.UsersGuideCommand" Executed="CommandBinding_Help" CanExecute="CommandBinding_CanExecute" />
    </Window.CommandBindings>
    <Window.InputBindings>
        <KeyBinding Key="O"
              Modifiers="Control"
              Command="ApplicationCommands.Open" />
        <KeyBinding Key="D"
              Modifiers="Control" 
              Command="ApplicationCommands.Delete" />
        <KeyBinding Key="X"
              Modifiers="Control" 
              Command="ApplicationCommands.Cut" />
        <KeyBinding Key="K"
              Modifiers="Control" 
              Command="ApplicationCommands.New" />
        <KeyBinding Key="S"
              Modifiers="Control" 
              Command="ApplicationCommands.Save" />
        <KeyBinding Key="F"
              Modifiers="Control"
              Command="ApplicationCommands.Find" 
              CommandParameter="{x:Static model:FilterMode.Search}"/>
        <KeyBinding Key="F"
              Modifiers="Control+Alt" 
              Command="ApplicationCommands.Find" 
              CommandParameter="{x:Static model:FilterMode.View}"/>
        <KeyBinding Key="F"
              Modifiers="Control+Shift" 
              Command="ApplicationCommands.Find" 
              CommandParameter="{x:Static model:FilterMode.Source}"/>
        <KeyBinding Key="Escape"              
              Command="{Binding StopReaderCommand}" />
        <KeyBinding Key="F4"   
                    Modifiers="Alt" 
                    Command="ApplicationCommands.Close" />
        <KeyBinding Key="F1"   
              Command="ApplicationCommands.Help" />
        <KeyBinding Key="F3"   
              Command="{Binding FindNextCommand}" />

        <KeyBinding Key="Q"
              Modifiers="Control" 
              Command="{x:Static views:QueryEditorView.OpenCommand}" 
              />

        <KeyBinding Key="N"
              Modifiers="Control" 
              Command="{x:Static views:QueryEditorView.NewCommand}" 
              />

    </Window.InputBindings>
    <Window.Style>
        <Style TargetType="Window" BasedOn="{StaticResource MetroWindow}">
        </Style>
    </Window.Style>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="23"></RowDefinition>
        </Grid.RowDefinitions>
        <Menu Grid.Row="0" 
              Name="mainMenu" 
              IsMainMenu="True" 
              Background="Transparent"
              KeyboardNavigation.IsTabStop="False" Padding="5,0,5,0">
            <MenuItem Header="_FILE">
                <MenuItem Header="_OPEN" Command="ApplicationCommands.Open" InputGestureText="Ctrl+O" >
                </MenuItem>
                <MenuItem Header="E_XIT" Command="ApplicationCommands.Close" InputGestureText="Alt+F4" />
            </MenuItem>
            <MenuItem Header="Trace" Visibility="Collapsed">
                <MenuItem Header="Start" Command="New" InputGestureText="Ctrl+K" >
                </MenuItem>
                <MenuItem Header="Stop"  Command="Save" InputGestureText="Ctrl+S" >
                </MenuItem>
            </MenuItem>
            <MenuItem Header="_VIEW" x:Name="ViewMenu">
                <MenuItem Header="_ERRORS"   Click="ShowErrors_Click">
                </MenuItem>
                <MenuItem Name="DurationStats" Header="_DURATIONS" Click="DurationStats_Click"/>
                <Separator />
                <MenuItem Header="FILTER _SOURCE" InputGestureText="Ctrl+Shift+F" Command="ApplicationCommands.Find" 
                          CommandParameter="{x:Static model:FilterMode.Source}"></MenuItem>
                <MenuItem Header="FILTER _EVENTS" InputGestureText="Ctrl+Atl+F" Command="ApplicationCommands.Find"
                          CommandParameter="{x:Static model:FilterMode.View}"></MenuItem>
                <MenuItem Header="SEARCH" InputGestureText="Ctrl+F" 
                          Command="ApplicationCommands.Find"
                          CommandParameter="{x:Static model:FilterMode.Search}"></MenuItem>
                <Separator></Separator>
                <MenuItem Header="_REFRESH" InputGestureText="F5" Command="Refresh"></MenuItem>
                <MenuItem Header="_STOP"  Command="{Binding StopReaderCommand}" InputGestureText="Esc" />
                <MenuItem Header="EVENT ST_ATS" Command="{Binding Path=EventStatsModel.ViewStatsCommand, ElementName=window}" />
            </MenuItem>
            <MenuItem Header="_MANIFESTS">
                <MenuItem Header="_ADD" Name="AddManifestMenu" Click="AddManifestMenu_Click"  InputGestureText="Ctrl+M"/>
            </MenuItem>
            <MenuItem Header="_QUERY" Name="QueriesMenu">
                <MenuItem Header="_NEW" Command="{x:Static views:QueryEditorView.NewCommand}" InputGestureText="Ctrl+N"/>
                <MenuItem Header="_OPEN" Name="AddLinqQueryMenu"  Command="{x:Static views:QueryEditorView.OpenCommand}"  InputGestureText="Ctrl+Q"/>
                <Separator></Separator>
            </MenuItem>
            <MenuItem Header="_HELP"  Command="ApplicationCommands.Help" InputGestureText="F1" >
            </MenuItem>
        </Menu>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" Margin="0">
                <Expander Name="TimelinePanel"  Margin="5,0,0,0"
                          ExpandDirection="Right" 
                          IsExpanded="True" 
                          BorderThickness="0"
                          Foreground="{StaticResource HighlightBrush}"
                          Visibility="Collapsed">
                    <ctrls:TimelineChart Margin="0,0,0,0"
                                x:Name="EventTimeline"                                  
                                Height="150"                                
                                BorderBrush="LightGray" BorderThickness="0"/>
                </Expander>
            </Grid>
        </Grid>
        <Grid Grid.Row="2" Name="GridEventsAndProvider" Margin="0,0,0,0"
              Visibility="{Binding Path=CanShowEvents, Converter={StaticResource BooleanToVisibilityConverter}}" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="10"></RowDefinition>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid  Grid.Row="0" x:Name="FindPanel">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <ctrls:FilterBox Grid.Column="0" x:Name="filterbox" Margin="5"
                             utils:HelpProvider.Help="filters"               
                             TabIndex="1"                              
                             Tag="SOURCE OR EVENTS FILTER OR SEARCH TEXT">
                </ctrls:FilterBox>
            </Grid>
            <GridSplitter Grid.Row="1"  ResizeDirection="Rows" Height="10"  HorizontalAlignment="Stretch" Focusable="False"></GridSplitter>
            <Grid Grid.Row="2" 
                  Margin="0,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="Auto" ></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid Grid.Row="0" Grid.Column="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <AdornerDecorator>
                        <ctrls:EventsGrid x:Name="eventsGrid"></ctrls:EventsGrid>
                    </AdornerDecorator>
                </Grid>
                <Expander Grid.Row="0" Grid.Column="1"
                    Margin="10,0,0,0"
                    Name="myExpander"                              
                    HorizontalAlignment="Left" 
                    ExpandDirection="Left" 
                    IsExpanded="False"
                      Style="{StaticResource FilterAndDurationExpanderStyle}"
                      Visibility="{Binding Path=Manifests, Converter={StaticResource NullToVisibilityConverter}}">
                    <ScrollViewer VerticalScrollBarVisibility="Auto">
                        <StackPanel Orientation="Vertical" Margin="5">
                            <GroupBox Header="PROVIDERS" Margin="0,0,0,10">
                                <ListBox Width="300" x:Name="ProviderFilterListBox" 
                                 VerticalAlignment="Top" 
                                 IsSynchronizedWithCurrentItem="True"
                                 ItemsSource="{Binding Path=Providers}" 
                                 Style="{StaticResource ListboxyStyle}"
                                 HorizontalAlignment="Left" BorderThickness="0" 
                                  SelectionChanged="ProviderFilterListBox_SelectionChanged">
                                    <ListBox.ItemTemplate>
                                        <DataTemplate DataType="x:Type">
                                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                                                <CheckBox  IsChecked="{Binding Path=IsChecked}" Width="20" />
                                                <TextBlock Text="{Binding Path=Name}" 
                                                       Width="Auto" 
                                                       HorizontalAlignment="Stretch" ToolTip="{Binding Path=Item.Id}">
                                                </TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>
                                </ListBox>
                            </GroupBox>
                            <GroupBox Header="KEYWORDS" Margin="0,0,0,10">
                                <ListBox  x:Name="KeywordFilterListBox" 
                                      ItemsSource="{Binding Path=Keywords}" VerticalAlignment="Top"                                       
                                      Style="{StaticResource ListboxyStyle}">
                                    <ListBox.ItemTemplate>
                                        <HierarchicalDataTemplate>
                                            <CheckBox Content="{Binding Path=Item.Name, Mode=OneWay}"  IsChecked="{Binding IsChecked}"  >
                                                <CheckBox.ToolTip>
                                                    <Label Content="{Binding Path=Item.Mask, Converter={StaticResource ToStringFormatConverter}, ConverterParameter=x}" />
                                                </CheckBox.ToolTip>
                                            </CheckBox>
                                        </HierarchicalDataTemplate>
                                    </ListBox.ItemTemplate>
                                    <!--<ListBox.ItemContainerStyle>
                                    <Style TargetType="ListBoxItem">
                                        <Setter Property="IsSelected" Value="{Binding Path=IsChecked}"/>
                                    </Style>
                                </ListBox.ItemContainerStyle>-->
                                </ListBox>
                            </GroupBox>
                            <GroupBox Header="REQUEST DURATION" Margin="0,0,0,10" Padding="10">
                                <StackPanel>
                                    <WrapPanel Margin="0,0,0,5">
                                        <TextBlock  VerticalAlignment="Center" Margin="0,0,10,0" Width="40"
                                       Style="{StaticResource ControlLabelStyle}">START</TextBlock>
                                        <ComboBox Width="240"  
                                    x:Name="StartEvent" 
                                    HorizontalAlignment="Left" 
                                    VerticalAlignment="Top" 
                                    IsEditable="True"  
                                    IsTextSearchEnabled="True" 
                                    IsTextSearchCaseSensitive="False"
                                    utils:HelpProvider.Help="durationStats">
                                        </ComboBox>
                                    </WrapPanel>
                                    <WrapPanel Margin="0,0,0,5">
                                        <TextBlock Margin="0,0,10,0" VerticalAlignment="Center"   Width="40"
                                           Style="{StaticResource ControlLabelStyle}">STOP</TextBlock>
                                        <ComboBox 
                          Width="240"
                          x:Name="StopEvent"  
                          HorizontalAlignment="Left" 
                          VerticalAlignment="Top" 
                          IsEditable="True" 
                          IsTextSearchEnabled="True"  
                          IsTextSearchCaseSensitive="False"
                          utils:HelpProvider.Help="durationStats">
                                        </ComboBox>
                                    </WrapPanel>

                                    <Button Name="BtnDuration"
                                Click="BtnDuration_Click" 
                                HorizontalAlignment="Left" 
                                VerticalAlignment="Center">FIND DURATION</Button>

                                </StackPanel>
                            </GroupBox>
                        </StackPanel>
                    </ScrollViewer>
                </Expander>

            </Grid>
        </Grid>
        <Grid Grid.Row="3" Style="{StaticResource BottomStatusGrid}">
            <StatusBar x:Name="statusBar" 
                   Visibility="Visible" 
                   Height="25" 
                   DockPanel.Dock="Bottom" 
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Bottom"
                   Style="{StaticResource MetroStatusBar}">
                <StatusBar.ItemsPanel>
                    <ItemsPanelTemplate>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="20"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                        </Grid>
                    </ItemsPanelTemplate>
                </StatusBar.ItemsPanel>
                <StatusBarItem Grid.Column="0">
                    <ctrls:Spinny x:Name="Spinny"                           
                          Visibility="{Binding Path=IsBusy, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"                          
                          Foreground="{Binding Path=IsRealTime, Mode=OneWay, Converter={StaticResource RealTimeSpinnyConverter}}" >
                    </ctrls:Spinny>
                </StatusBarItem>
                <StatusBarItem Grid.Column="1" VerticalAlignment="Center">
                    <StackPanel Orientation="Horizontal">
                        <TextBox Name="txtStatus"                                 
                                 Padding="0,0,10,0"
                                 Style="{StaticResource StatusBarTextBox}"
                                 Text="{Binding Path=Activity, Mode=OneWay}"
                                 IsReadOnly="True"></TextBox>
                        <!-- Source Row and filtered Row Count-->
                        <StackPanel Orientation="Horizontal"
                                    Visibility="{Binding Path=Reader, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Padding="10,0,3,0" Style="{StaticResource StatusBarLabel}"
                                       ToolTip="{Binding Path=EventsModel.SourceFilter, ElementName=window}">SOURCE:</TextBlock>
                            <TextBlock VerticalAlignment="Center" Style="{StaticResource StatusBarLabel}"
                                       Text="{Binding Path=EventsModel.RowCount, ElementName=window}"/>
                            <TextBlock Padding="10,0,3,0" Style="{StaticResource StatusBarLabel}"
                                       ToolTip="{Binding Path=EventsModel.ViewFilter, ElementName=window}">FILTERED:</TextBlock>
                            <TextBlock VerticalAlignment="Center" Style="{StaticResource StatusBarLabel}"
                                       Text="{Binding Path=EventsModel.FilteredRowCount, ElementName=window}"/>
                        </StackPanel>

                        <StackPanel Orientation="Horizontal"
                                    Visibility="{Binding Path=EventsModel.CurrentRow, ElementName=window, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Padding="10,0,3,0" Style="{StaticResource StatusBarLabel}">ROW:</TextBlock>
                            <TextBlock VerticalAlignment="Center" Style="{StaticResource StatusBarLabel}"
                                   Text="{Binding Path=EventsModel.CurrentRow, ElementName=window}"/>
                        </StackPanel>

                        <StackPanel Orientation="Horizontal"
                                    Visibility="{Binding Path=EventsModel.SelectedTimeWindow, ElementName=window, Converter={StaticResource TimeSpanToVisibility}}">
                            <TextBlock Padding="20,0,5,0" FontFamily="Symbol">D</TextBlock>
                            <TextBlock Name="txtDuration"  
                                   Padding="0"
                                   VerticalAlignment="Center" 
                                       Style="{StaticResource StatusBarLabel}"
                                   />
                        </StackPanel>
                    </StackPanel>
                </StatusBarItem>
                <StatusBarItem HorizontalAlignment="Right" 
                               Grid.Column="2" 
                               VerticalAlignment="Center">
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Orientation="Horizontal"
                                Visibility="{Binding Path=CanSelectTimeWindow, Converter={StaticResource BooleanToVisibilityConverter}}" 
                                Height="{Binding ActualHeight, ElementName=statusBar}">
                            <TextBlock Padding="10,0,5,0" 
                                   VerticalAlignment="Center" Style="{DynamicResource StatusBarLabel}">
                            <Run Text="START"/>
                            </TextBlock>
                            <TextBox x:Name="txtStartTime"                                 
                                 Width="148"
                                 Padding="10,0,10,0"
                                 MaxWidth="200"                             
                                 Margin="0,0,10,0"
                                 BorderThickness="0" 
                                 VerticalContentAlignment="Center"                             
                                 Foreground="{Binding Foreground, ElementName=statusBar}"                              
                                 Height="{Binding ActualHeight, ElementName=statusBar}"
                                 Style="{DynamicResource StatusBarTextBox}"
                                 SourceUpdated="txtStartTime_SourceUpdated">
                                <TextBox.Text>
                                    <Binding Path="StartTime"                             
                                        Mode="TwoWay"
                                        NotifyOnSourceUpdated="True" 
                                        NotifyOnTargetUpdated="True"
                                        Converter="{StaticResource TimeIntervalConverter}"></Binding>
                                </TextBox.Text>
                            </TextBox>
                            <TextBlock Padding="0,0,5,0" VerticalAlignment="Center" Style="{StaticResource StatusBarLabel}">
                                <Run Text="STOP"/></TextBlock>
                            <TextBox x:Name="txtStopTime" 
                                 Width="148"
                                 Padding="10,0,10,0"
                                 MaxWidth="200"                             
                                 Margin="0,0,20,0"
                                 BorderThickness="0" 
                                 VerticalContentAlignment="Center"                             
                                 Foreground="{Binding Foreground, ElementName=statusBar}"                              
                                 Height="{Binding ActualHeight, ElementName=statusBar}"
                                 Style="{StaticResource StatusBarTextBox}"
                                 SourceUpdated="txtStopTime_SourceUpdated">
                                <TextBox.Text>
                                    <Binding Path="StopTime"                              
                                         Mode="TwoWay" 
                                         NotifyOnSourceUpdated="True" 
                                         NotifyOnTargetUpdated="True"
                                         Converter="{StaticResource TimeIntervalConverter}"></Binding>
                                </TextBox.Text>
                            </TextBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <StackPanel Orientation="Horizontal" 
                                    Visibility="{Binding Path=IsRealTime, Converter={StaticResource BooleanToVisibilityConverter}}" >
                                <TextBlock VerticalAlignment="Center"><Run Text="SESSION:"/></TextBlock>
                                <TextBox VerticalAlignment="Center" 
                                     Padding="0,0,20,0" 
                                    Style="{StaticResource StatusBarTextBox}"                        
                                    Text="{Binding Path=Session, Mode=OneWay}"
                                    IsReadOnly="True" />

                            </StackPanel>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Padding="0,0,5,0" VerticalAlignment="Center">
                                <Hyperlink Command="{x:Static l:LogViewer.ShowLog}"
                                 Background="{Binding Background, ElementName=statusBar}" 
                                 Foreground="{Binding Foreground, ElementName=statusBar}" 
                                   >LOG</Hyperlink>
                            </TextBlock>
                            <TextBlock 
                                VerticalAlignment="Bottom" 
                                HorizontalAlignment="Right" 
                                Padding="0,15,0,0" 
                                FontSize="10" 
                                FontFamily="Marlett">
                                
                            </TextBlock>
                        </StackPanel>
                    </StackPanel>
                </StatusBarItem>
            </StatusBar>
        </Grid>
    </Grid>
</Window>
